from threading import Thread, enumerate
import time


def test1():
    for i in range(5):
        print("-------test1------> %d" %i)
        time.sleep(1)


def test2():
    for i in range(5):
        print("-------test2------> %d" %i)
        time.sleep(1)


def main():
    t1 = Thread(target=test1)
    t2 = Thread(target=test2)

    t1.start()
    t2.start()

    while True:
        print(enumerate())
        if len(enumerate()) <= 1:
            break
        time.sleep(1)


if __name__ == '__main__':
    main()
    